home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / Aliases.p < prev    next >
Encoding:
Text File  |  1997-08-12  |  6.0 KB  |  165 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Aliases.p
  3.  
  4.      Contains:    Alias Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1989-1997, 1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT Aliases;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __ALIASES__}
  28. {$SETC __ALIASES__ := 1}
  29.  
  30. {$I+}
  31. {$SETC AliasesIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __APPLETALK__}
  38. {$I AppleTalk.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __FILES__}
  41. {$I Files.p}
  42. {$ENDC}
  43.  
  44.  
  45. {$PUSH}
  46. {$ALIGN MAC68K}
  47. {$LibExport+}
  48.  
  49.  
  50. CONST
  51.     rAliasType                    = 'alis';                        {  Aliases are stored as resources of this type  }
  52.  
  53.                                                                 {  define alias resolution action rules mask  }
  54.     kARMMountVol                = $00000001;                    {  mount the volume automatically  }
  55.     kARMNoUI                    = $00000002;                    {  no user interface allowed during resolution  }
  56.     kARMMultVols                = $00000008;                    {  search on multiple volumes  }
  57.     kARMSearch                    = $00000100;                    {  search quickly  }
  58.     kARMSearchMore                = $00000200;                    {  search further  }
  59.     kARMSearchRelFirst            = $00000400;                    {  search target on a relative path first  }
  60.  
  61.                                                                 {  define alias record information types  }
  62.     asiZoneName                    = -3;                            {  get zone name  }
  63.     asiServerName                = -2;                            {  get server name  }
  64.     asiVolumeName                = -1;                            {  get volume name  }
  65.     asiAliasName                = 0;                            {  get aliased file/folder/volume name  }
  66.     asiParentName                = 1;                            {  get parent folder name  }
  67.  
  68. { define the alias record that will be the blackbox for the caller }
  69.  
  70. TYPE
  71.     AliasRecordPtr = ^AliasRecord;
  72.     AliasRecord = RECORD
  73.         userType:                OSType;                                    {  appl stored type like creator type  }
  74.         aliasSize:                INTEGER;                                {  alias record size in bytes, for appl usage  }
  75.     END;
  76.  
  77.     AliasPtr                            = ^AliasRecord;
  78.     AliasHandle                            = ^AliasPtr;
  79. { alias record information type }
  80.     AliasInfoType                        = INTEGER;
  81. {  create a new alias between fromFile-target and return alias record handle  }
  82. FUNCTION NewAlias(fromFile: ConstFSSpecPtr; {CONST}VAR target: FSSpec; VAR alias: AliasHandle): OSErr;
  83.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  84.     INLINE $7002, $A823;
  85.     {$ENDC}
  86. { create a minimal new alias for a target and return alias record handle }
  87. FUNCTION NewAliasMinimal({CONST}VAR target: FSSpec; VAR alias: AliasHandle): OSErr;
  88.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  89.     INLINE $7008, $A823;
  90.     {$ENDC}
  91. { create a minimal new alias from a target fullpath (optional zone and server name) and return alias record handle  }
  92. FUNCTION NewAliasMinimalFromFullPath(fullPathLength: INTEGER; fullPath: UNIV Ptr; zoneName: ConstStr32Param; serverName: ConstStr31Param; VAR alias: AliasHandle): OSErr;
  93.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  94.     INLINE $7009, $A823;
  95.     {$ENDC}
  96. { given an alias handle and fromFile, resolve the alias, update the alias record and return aliased filename and wasChanged flag. }
  97. FUNCTION ResolveAlias(fromFile: ConstFSSpecPtr; alias: AliasHandle; VAR target: FSSpec; VAR wasChanged: BOOLEAN): OSErr;
  98.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  99.     INLINE $7003, $A823;
  100.     {$ENDC}
  101. { given an alias handle and an index specifying requested alias information type, return the information from alias record as a string. }
  102. FUNCTION GetAliasInfo(alias: AliasHandle; index: AliasInfoType; VAR theString: Str63): OSErr;
  103.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  104.     INLINE $7007, $A823;
  105.     {$ENDC}
  106.   Given a file spec, return target file spec if input file spec is an alias.
  107.   It resolves the entire alias chain or one step of the chain.  It returns
  108.   info about whether the target is a folder or file; and whether the input
  109.   file spec was an alias or not. 
  110. }
  111. FUNCTION ResolveAliasFile(VAR theSpec: FSSpec; resolveAliasChains: BOOLEAN; VAR targetIsFolder: BOOLEAN; VAR wasAliased: BOOLEAN): OSErr;
  112.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  113.     INLINE $700C, $A823;
  114.     {$ENDC}
  115. FUNCTION FollowFinderAlias(fromFile: ConstFSSpecPtr; alias: AliasHandle; logon: BOOLEAN; VAR target: FSSpec; VAR wasChanged: BOOLEAN): OSErr;
  116.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  117.     INLINE $700F, $A823;
  118.     {$ENDC}
  119.    Low Level Routines 
  120. }
  121. { given a fromFile-target pair and an alias handle, update the lias record pointed to by alias handle to represent target as the new alias. }
  122. FUNCTION UpdateAlias(fromFile: ConstFSSpecPtr; {CONST}VAR target: FSSpec; alias: AliasHandle; VAR wasChanged: BOOLEAN): OSErr;
  123.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  124.     INLINE $7006, $A823;
  125.     {$ENDC}
  126.  
  127.  
  128. TYPE
  129.     AliasFilterProcPtr = ProcPtr;  { FUNCTION AliasFilter(cpbPtr: CInfoPBPtr; VAR quitFlag: BOOLEAN; myDataPtr: Ptr): BOOLEAN; }
  130.  
  131.     AliasFilterUPP = UniversalProcPtr;
  132.  
  133. CONST
  134.     uppAliasFilterProcInfo = $00000FD0;
  135.  
  136. FUNCTION NewAliasFilterProc(userRoutine: AliasFilterProcPtr): AliasFilterUPP;
  137.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  138.     INLINE $2E9F;
  139.     {$ENDC}
  140.  
  141. FUNCTION CallAliasFilterProc(cpbPtr: CInfoPBPtr; VAR quitFlag: BOOLEAN; myDataPtr: Ptr; userRoutine: AliasFilterUPP): BOOLEAN;
  142.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  143.     INLINE $205F, $4E90;
  144.     {$ENDC}
  145.  
  146. {  Given an alias handle and fromFile, match the alias and return aliased filename(s) and needsUpdate flag }
  147. FUNCTION MatchAlias(fromFile: ConstFSSpecPtr; rulesMask: LONGINT; alias: AliasHandle; VAR aliasCount: INTEGER; aliasList: FSSpecArrayPtr; VAR needsUpdate: BOOLEAN; aliasFilter: AliasFilterUPP; yourDataPtr: UNIV Ptr): OSErr;
  148.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  149.     INLINE $7005, $A823;
  150.     {$ENDC}
  151.  
  152.  
  153. {$ALIGN RESET}
  154. {$POP}
  155.  
  156. {$SETC UsingIncludes := AliasesIncludes}
  157.  
  158. {$ENDC} {__ALIASES__}
  159.  
  160. {$IFC NOT UsingIncludes}
  161.  END.
  162. {$ENDC}
  163.